import request from '@/utils/request'

export function registerByPhone(params) {
    return request({
        url: `/ucenter/user/registerByPhone`,
        method: 'post',
        data: params
    })
}

export function loginByPhone(user) {
    return request({
        url: `/ucenter/user/loginByPhone`,
        method: 'post',
        data: user,

    })
}

export function getLoginInfo() {
    return request({
        url: `/ucenter/user/getLoginInfo`,
        method: 'get',
    })
}

export function updateUser(user) {
    return request({
        url: `ucenter/user/updateUser`,
        method: 'post',
        data: user
    })
}

export function loginByCode(user) {
    return request({
        url: `ucenter/user/loginByCode`,
        method: 'post',
        data: user
    })
}

export function logout() {
    return request({
        url: `ucenter/user/logout`,
        method: 'post',
    })
}

export function updatePassword(mobile, newPassword, code) {
    return request({
        url: `ucenter/user/updatePassword/${mobile}/${newPassword}/${code}`,
        method: 'post',
    })
}